package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "zfhuodan", schema = "springboot", catalog = "")
public class ZfhuodanEntity {
    private int shipmentsId;
   /* private Integer scustomeId;*/
    private String fhuoDan;
    private BigDecimal samoUnt;
    private String kauidGs;
    private String kauidHao;
    private Integer shouhzId;
    private Integer sFzr;
    private Integer sorderId;
    private Integer sdeliveryId;

    private Timestamp shipmentsTime;
    private Integer shipmentsState;

    private Customer customer;

    @Id
    @Column(name = "shipments_id", nullable = false)
    public int getShipmentsId() {
        return shipmentsId;
    }

    public void setShipmentsId(int shipmentsId) {
        this.shipmentsId = shipmentsId;
    }

  /*  @Basic
    @Column(name = "scustome_id", nullable = true)
    public Integer getScustomeId() {
        return scustomeId;
    }

    public void setScustomeId(Integer scustomeId) {
        this.scustomeId = scustomeId;
    }
*/
    @Basic
    @Column(name = "fhuo_dan", nullable = true, length = 255)
    public String getFhuoDan() {
        return fhuoDan;
    }

    public void setFhuoDan(String fhuoDan) {
        this.fhuoDan = fhuoDan;
    }

    @Basic
    @Column(name = "samo_unt", nullable = true, precision = 3)
    public BigDecimal getSamoUnt() {
        return samoUnt;
    }

    public void setSamoUnt(BigDecimal samoUnt) {
        this.samoUnt = samoUnt;
    }

    @Basic
    @Column(name = "kauid_gs", nullable = true, length = 255)
    public String getKauidGs() {
        return kauidGs;
    }

    public void setKauidGs(String kauidGs) {
        this.kauidGs = kauidGs;
    }

    @Basic
    @Column(name = "kauid_hao", nullable = true, length = 255)
    public String getKauidHao() {
        return kauidHao;
    }

    public void setKauidHao(String kauidHao) {
        this.kauidHao = kauidHao;
    }

    @Basic
    @Column(name = "shouhz_id", nullable = true)
    public Integer getShouhzId() {
        return shouhzId;
    }

    public void setShouhzId(Integer shouhzId) {
        this.shouhzId = shouhzId;
    }

    @Basic
    @Column(name = "s_fzr", nullable = true)
    public Integer getsFzr() {
        return sFzr;
    }

    public void setsFzr(Integer sFzr) {
        this.sFzr = sFzr;
    }

    @Basic
    @Column(name = "sorder_id", nullable = true)
    public Integer getSorderId() {
        return sorderId;
    }

    public void setSorderId(Integer sorderId) {
        this.sorderId = sorderId;
    }

    @Basic
    @Column(name = "sdelivery_id", nullable = true)
    public Integer getSdeliveryId() {
        return sdeliveryId;
    }

    public void setSdeliveryId(Integer sdeliveryId) {
        this.sdeliveryId = sdeliveryId;
    }


    @Basic
    @Column(name = "shipments_time", nullable = true)
    public Timestamp getShipmentsTime() {
        return shipmentsTime;
    }

    public void setShipmentsTime(Timestamp shipmentsTime) {
        this.shipmentsTime = shipmentsTime;
    }


    @Basic
    @Column(name = "shipments_state", nullable = true)
    public Integer getShipmentsState() {
        return shipmentsState;
    }

    public void setShipmentsState(Integer shipmentsState) {
        this.shipmentsState = shipmentsState;
    }

    @ManyToOne
    @JoinColumn(name = "scustome_id",referencedColumnName = "custom_id")
    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ZfhuodanEntity that = (ZfhuodanEntity) o;
        return shipmentsId == that.shipmentsId &&
                Objects.equals(fhuoDan, that.fhuoDan) &&
                Objects.equals(samoUnt, that.samoUnt) &&
                Objects.equals(kauidGs, that.kauidGs) &&
                Objects.equals(kauidHao, that.kauidHao) &&
                Objects.equals(shouhzId, that.shouhzId) &&
                Objects.equals(sFzr, that.sFzr) &&
                Objects.equals(sorderId, that.sorderId) &&
                Objects.equals(sdeliveryId, that.sdeliveryId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(shipmentsId, fhuoDan, samoUnt, kauidGs, kauidHao, shouhzId, sFzr, sorderId, sdeliveryId);
    }
}
